﻿using BuzzX8.Xmpp.StreamElements.Stanza;

namespace BuzzX8.Xmpp.StreamElements.Factories
{
    public abstract class StanzaFactory<TType, TStanza, TModel> : DatagramElementFactory<TStanza, TModel> where TStanza : Stanza<TType>
                                                                                                          where TModel : StanzaModel<TType>
    {
        protected override void UpdateElementByModel(TStanza element, TModel model)
        {
            base.UpdateElementByModel(element, model);
            element.Type = model.Type;
        }

        protected override ErrorElement CreateNewErrorElement()
        {
            return new StanzaError(StanzaErrorType.Auth);
        }
    }
}
